<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/jquery.js"></script>
    <style>
    </style>
</head>
<body>
    <script>
        $(function(){
            $(window).on("resize",function(){
                var w=$(window).width()
                console.log(w);
                if(w>0&&w<=550){
                    $("body").css("backgroundColor","red")
                }else if(w>550&&w<=600){
                    $("body").css("backgroundColor","yellow")
                }else if(w>600&&w<=800){
                    $("body").css("backgroundColor","yellowgreen")
                }else if(w>800&&w<=1000){
                    $("body").css("backgroundColor","skyblue")
                }else {
                    $("body").css("backgroundColor","green")
                }
            })
            $(window).resize()
        })
    </script>
</body>
</html>